c###gphbod.for
      SUBROUTINE GPHBOD
C--------------------------------
C
C     THIS ROUTINE CREATES LINE PRINTER GRAPHS OF THE VARIABLES SET IN
C     SUBROUTINE SETGPH -THE GRAPHS OUTPUT DEPEND ON METHOD BUT THE
C     USER MAY SPECIFY ADDITIONAL GRAPHS VIA THE "OUTGRAPH" CONTROL CARD
C
      COMMON / FILES / LUI, LUO, LU2, LU5, LU6, LU15, LU16, LU20, LU25,
     A LU26, LU35
      COMMON / OUTGH / PLOTI(24), PLOTJ(24), PLOTK(24), XOUT(13), NPLOTS
      COMMON / OUTLAB / LABEL(11), LAYTYP(5), IEAST, INORTH, ISOUTH,
     A IWEST, LABLI, LABLJ, LABLK
      CHARACTER IEAST*1, ISOUTH*1, INORTH*1, IWEST*1, LABEL*5, LAYTYP*2,
     A LABLI*5, LABLJ*5, LABLK*5
      COMMON / OUTPRT / LINBOT(26), LINBD(14), LINTOP(15), LINTP(14),
     A GRPTYP, JOUT, LINBYP, LINES, LINMAX, LINTYP, LPAGES, NLINE
      COMMON / TIME / IT, GMT, UTIME(24), GMTR, XLMT(24), ITIM, JTX
      CHARACTER IHR(40)*2, IBLANK*6, ISYMBL*6, JSYMBL*6, KSYMBL*6,
     A ICHARS*6, JCHARS*6, KCHARS*6, NDASH*1, LTIME*4, ICHAR*6, JCHAR*6,
     B KCHAR*6, LIN(25)*6
      DATA IHR/'40','  ','38','  ','36','  ','34','  ','32','  ','30',
     A    '  ','28','  ','26','  ','24','  ','22','  ','20','  ','18',
     2    '  ','16','  ','14','  ','12','  ','10','  ','08','  ','06',
     3    '  ','04','  ','02','  '/
      DATA IBLANK/'      '/, ISYMBL/'.     '/, JSYMBL/'X     '/,
     A KSYMBL/'+     '/, NHR/24/
      DATA ICHARS/'(....)'/, JCHARS/'(XXXX)'/, KCHARS/'(++++)'/,
     A NDASH/'-'/, LTIME/' GMT'/, ONE/-.99/, NHRP1/25/
      JOUT = LUO
      ICHAR = ICHARS
      JCHAR = JCHARS
      KCHAR = KCHARS
C.....CHECK THE NUMBER OF VARIABLES TO PLOT
      IF(NPLOTS) 110, 110, 120
  110 LABLI = IBLANK
      LABLJ = IBLANK
      LABLK = IBLANK
      GO TO 710
C.....PRINT TOP SCALES
  120 IF(NPLOTS - 2) 122, 124, 126
  122 JCHAR = IBLANK
      KCHAR = IBLANK
      GO TO 126
  124 KCHAR = IBLANK
  126 WRITE(JOUT,1500) LABLI, ICHAR, LABLJ, JCHAR, LABLK, KCHAR
      WRITE(JOUT,1508)
      WRITE(JOUT,1510)
      ZOB2 = 40.5
      IT = 1
      DO 700 IDN = 1, 40
C.....BLANK OUT THE CURRENT LINE
      DO 130 ICR = 1,NHRP1
  130 LIN(ICR) = IBLANK
      ZOB1 = ZOB2
      ZOB2 = ZOB1 - 1.
C.....SET PLOTTING SYMBOL FOR THE FIRST VARIABLE
      DO 170 ICR = 1,NHR
      IF(PLOTI(ICR) - ONE) 170, 170, 140
  140 IF(PLOTI(ICR) - ZOB1) 150, 150, 170
  150 IF(PLOTI(ICR) - ZOB2) 170, 170, 160
  160 ICRP1 = ICR + 1
      LIN(ICRP1) = ISYMBL
      IF(ICR - NHR) 170, 165, 170
  165 LIN(1) = ISYMBL
  170 CONTINUE
C.....SET PLOTTING SYMBOL FOR THE SECOND VARIABLE
      IF(NPLOTS - 2) 280, 180, 180
  180 DO 220 ICR = 1,NHR
      IF(PLOTJ(ICR) - ONE) 220, 220, 190
  190 IF(PLOTJ(ICR) - ZOB1) 200, 200, 220
  200 IF(PLOTJ(ICR) - ZOB2) 220, 220, 210
  210 ICRP1 = ICR + 1
      LIN(ICRP1) = JSYMBL
      IF(ICR - NHR) 220, 215, 220
  215 LIN(1) = JSYMBL
  220 CONTINUE
C.....SET PLOTTING SYMBOL FOR THE THIRD VARIABLE
      IF(NPLOTS - 3) 280, 230, 230
  230 DO 270 ICR = 1,NHR
      IF(PLOTK(ICR) - ONE) 270, 270, 240
  240 IF(PLOTK(ICR) - ZOB1) 250, 250, 270
  250 IF(PLOTK(ICR) - ZOB2) 270, 270, 260
  260 ICRP1 = ICR + 1
      LIN(ICRP1) = KSYMBL
      IF(ICR - NHR) 270, 265, 270
  265 LIN(1) = KSYMBL
  270 CONTINUE
C.....CONTROL OUTPUT ACCORDING TO LINE NUMBER
  280 IF(IDN - 5) 310, 320, 290
  290 IF(IDN - 7) 310, 330, 300
  300 IF(IDN - 30) 330, 330, 310
C.....PRINT GRAPH ONLY
  310 WRITE(JOUT,1512) IHR(IDN), LIN, IHR(IDN)
      GO TO 700
C.....PRINT THE GRAPHS AND THE HEADINGS
  320 WRITE(JOUT,1514) IHR(IDN),LIN,IHR(IDN),LTIME,LABLI,LABLJ,LABLK
      GO TO 700
C.....PRINT THE GRAPH AND THE VARIABLES
  330 IF(NHR - IT) 310, 332, 332
  332 IF(UTIME(IT)) 334, 336, 336
  334 IT = IT + 1
      GO TO 330
  336 IF(NPLOTS - 2) 340, 370, 440
C.....PLOT AND PRINT ONE VARIABLE
  340 IF(PLOTI(IT) - ONE) 350, 350, 360
  350 WRITE(JOUT,1515) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH
      GO TO 600
  360 WRITE(JOUT,1516) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT)
      GO TO 600
C.....PLOT AND PRINT TWO VARIABLES
  370 IF(PLOTI(IT) - ONE) 380, 380, 410
  380 IF(PLOTJ(IT) - ONE) 390, 390, 400
  390 WRITE(JOUT,1515) IHR(IDN), LIN,IHR(IDN),UTIME(IT),NDASH,NDASH
      GO TO 600
  400 WRITE(JOUT,1517) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH,PLOTJ(IT)
      GO TO 600
  410 IF(PLOTJ(IT) - ONE) 420, 420, 430
  420 WRITE(JOUT,1518) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),NDASH
      GO TO 600
  430 WRITE(JOUT,1516) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),
     1 PLOTJ(IT)
      GO TO 600
C.....PLOT AND PRINT THREE VARIABLES
  440 IF(PLOTI(IT) - ONE) 450, 450, 520
  450 IF(PLOTJ(IT) - ONE) 460, 460, 490
  460 IF(PLOTK(IT) - ONE) 470, 470, 480
  470 WRITE(JOUT,1515) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH,NDASH,NDASH
      GO TO 600
  480 WRITE(JOUT,1519) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH,NDASH,
     1 PLOTK(IT)
      GO TO 600
  490 IF(PLOTK(IT) - ONE) 500, 500, 510
  500 WRITE(JOUT,1520) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH,PLOTJ(IT),
     1 NDASH
      GO TO 600
  510 WRITE(JOUT,1521) IHR(IDN),LIN,IHR(IDN),UTIME(IT),NDASH,PLOTJ(IT),
     1 PLOTK(IT)
      GO TO 600
  520 IF(PLOTJ(IT) - ONE) 530, 530, 560
  530 IF(PLOTK(IT) - ONE) 540, 540, 550
  540 WRITE(JOUT,1522) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),NDASH,
     1 NDASH
      GO TO 600
  550 WRITE(JOUT,1523) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),NDASH,
     1 PLOTK(IT)
      GO TO 600
  560 IF(PLOTK(IT) - ONE) 570, 570, 580
  570 WRITE(JOUT,1524) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),
     1 PLOTJ(IT),NDASH
      GO TO 600
  580 WRITE(JOUT,1516) IHR(IDN),LIN,IHR(IDN),UTIME(IT),PLOTI(IT),
     1 PLOTJ(IT), PLOTK(IT)
  600 IT = IT + 1
  700 CONTINUE
      WRITE(JOUT,1510)
      WRITE(JOUT,1508)
      WRITE(JOUT,1525)
  710 CONTINUE
      RETURN
C.....FORMAT STATEMENTS
 1500 FORMAT(' ',//,10X,3(A5,A6,5X)/)
 1508 FORMAT (' ',6X,'00  02  04  06  08  10  12  14  16  18  20  22',
     A '  00')
 1510 FORMAT(' ',4X,'MHZ+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+',
     A'-+-+MHZ')
 1512 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2)
 1514 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,A4,3(1X,A5))
 1515 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,3(3X,A1,2X))
 1516 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,3F6.1)
 1517 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,3X,A1,2X,2F6.1)
 1518 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,F6.1,2(3X,A1,2X))
 1519 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,2(3X,A1,2X),F6.1)
 1520 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,3X,A1,2X,F6.1,3X,
     1 A1)
 1521 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,3X,A1,2X,2F6.1)
 1522 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,F6.1,2(3X,A1,2X))
 1523 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,F6.1,3X,A1,2X,
     1 F6.1)
 1524 FORMAT(' ',3X,A2,'-',25(1X,A1),1X,'-',A2,3X,F4.1,2F6.1,3X,A1)
 1525 FORMAT(' ',20X,'UNIVERSAL TIME')
      END
C--------------------------------
C--------------------------------
